package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SetmealMapper {



    @Select("select * from sky_take_out.setmeal where id=#{id}")
    Setmeal getById(Long id);

    List<Setmeal> list(Setmeal setmeal);


    @AutoFill(value = OperationType.INSERT)
    void insert(Setmeal setmeal);

    Page<SetmealVO> listWithCategory(Integer categoryId, String name, Integer status);

    void deleteByIds(List<Long> ids);

    @AutoFill(value = OperationType.UPDATE)
    void update(Setmeal setmeal);


    List<Setmeal>  getByCategoryId(Long categoryId,Integer status);
    default List<Setmeal>  getByCategoryId(Long categoryId){
        return getByCategoryId(categoryId,null);
    }
}
